package dataS.recusion;

public class HannuoTower {

    public void tower(int n, char from, char middle, char target) {
        if (n == 1) {
            System.out.println("盘子1，从" + from + "塔到" + target + "塔");
        } else {
            tower(n - 1, from, target, middle);
            System.out.println("盘子" + n + "，从" + from + "塔到" + target + "塔");
            tower(n - 1, middle, from, target);
        }
    }
}
